 #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
class A
{
	friend ostream& operator<<(ostream& out, const A& d);
public:
	A(int n = 2)
	{
		_num = n;
		cout << "A(int n)" << endl;
	}
	A(const A& d)
	{
		_num = d._num;
		cout << "A(A& d)" << endl;
	}
	~A()
	{
		cout << "~A()" << endl;
	}
private:
	int _num;
};
ostream& operator<<(ostream& out, const A& d)
{
	out << d._num;
	return cout;
}
void f1(A aa)
{
	cout << aa << endl;
}
int main()
{
	A a1;
	f1(a1);

	int a2 = 5;
	f1(a2);

	f1(A());

    // A a;
    // A b(a);//相当于A b=a; 是拷贝构造

	return 0;
}